package com.wr.hangzhounewlight.obj.database;

import com.baomidou.mybatisplus.annotation.*;
import com.wr.hangzhounewlight.obj.api.silorawmaterialmappingissue.SiloRawMaterialMappingIssueRequest.SiloMaterialSetDTO;
import lombok.Data;
import lombok.NoArgsConstructor;

import java.time.LocalDateTime;

/**
 * @author yuanzhizhuo
 * createDate 2025/10/24
 */
@Data
@NoArgsConstructor
@TableName("silo_raw_material_map")
public class SiloRawMaterialMapEntity {

    @TableId(type = IdType.AUTO)
    private Long id;
    private String workshop;
    private String silo;
    private String rawMaterialName;
    private String materialId;
    private String materialCode;
    private String materialName;
    @TableField(fill = FieldFill.INSERT)
    private LocalDateTime insertTime;

    public SiloRawMaterialMapEntity(String workshop, SiloMaterialSetDTO dto) {
        this.workshop = workshop;
        this.silo = dto.getSilo();
        this.rawMaterialName = dto.getRawMaterialName();
        this.materialId = dto.getMaterialId();
        this.materialCode = dto.getMaterialCode();
        this.materialName = dto.getMaterialName();
    }

}
